<!DOCTYPE html>

<html>
<head>
	<title>users</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
</head>
<body>
	<div class="table-responsive">
  <table class="table" id="myTable">
    <th></th>
    <tr><td>id</td><td>username</td><td>password</td><td>phone</td></tr>
  </table>
</div>
<script src="js/jquery.js"></script>
<script type="text/javascript">

$(document).ready(function(){
$.ajax({
		url:'http://localhost:8080/api/users',
		//url:'http://localhost/api/users',
		// type:'get',
		async:true,
		dataType: 'json',
        //crossDomain: true,
		success:function(data){
			console.log(data);
			for(var i=0;i<data.length;i++){
				$('#myTable').append('<tr><td>'+data[i].id+'</td><td>'+data[i].username+'</td><td>'+data[i].password+'</td><td>'+data[i].phone+'</td></tr>');
			}
			//$('#myTable').append
		},
		error:function(data){
			console.log(data);
			//console.log(data[0].id);

		}
	})
	});
</script>
</body>

	


</html>